package com.huangfu.easysardine.gate;


import com.huangfu.easysardine.gate.utils.DBLog;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.session.data.redis.RedisFlushMode;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * Created with IntelliJ IDEA.
 * User: huangfu.daohui
 * Date: 2017-7-28
 * Time: 17:24
 * Description:网关主类
 */
@SpringBootApplication
@EnableDiscoveryClient
//开启feign功能
@EnableFeignClients
@EnableZuulProxy
//EnableRedisHttpSession开启redis集中式session管理，所有的session都存放到了redis中
//在项目中增加下面代码，就完成了session共享存储到redis的所有代码（redis当然要提前配好）。
//告诉Redis立即保存session
@EnableRedisHttpSession(redisFlushMode = RedisFlushMode.IMMEDIATE)
public class GateBootstrap {
    public static void main(String[] args) {
        DBLog.getInstance().start();
        SpringApplication.run(GateBootstrap.class, args);
    }
}
